def get_formatted_name(first, last):
    full_name = f"{first} {last}"
    return full_name.title()


# print('随时输入 q 退出')
# while True:
#     first = input('Please give me first name: ')
#     if first == 'q':
#         break
#     last = input('Please give me last name: ')
#     if last == 'q':
#         break
#     formatted_name = get_formatted_name(first, last)
#     print(f'FullName is {formatted_name}')

# 单元测试
import unittest


class NameTestCase(unittest.TestCase):
    def test_first_last_name(self):
        formatted_name = get_formatted_name('ray', 'allen')
        self.assertEqual(formatted_name, 'Ray Allen')


if __name__ == '__main__':
    unittest.main()
